#include "../../libraries/sockets/tcp_client.h"

#include <iostream>

using namespace std; 

int main(int argc, char *argv[])

{

    int n;
    string message, answer;
    if (argc < 3) {
        cout << "usage" << argv[0] << "hostname port" << endl;
        exit(0);
    }

    TCP_client client(argv[1], atoi (argv[2]));

while (1){

        cout << "Write a message for the server: " << endl;
        cin >> message;

        client<<message;

        cout << "Server says: " << endl;
        client>>answer;

        cout << answer << endl;

	}
  return 0;
}
